﻿@model PagedList.IPagedList<CultuRAM.Models.AccreditingState>


@{
    ViewBag.Title = "Parâmetro: Estados do Pedido de Adesão";
    
    int idP = 0;

    if (!String.IsNullOrEmpty(ViewBag.IdParam.ToString()))
    {
        idP = ViewBag.IdParam;
    }
}

@*@Html.Partial("_Messages")*@

<table id="tabParam" class="table table-hover table-striped table-bordered" style="width:100%;">
    <tr style="font-size: 12px">
        <th>
            @Html.DisplayNameFor(model => model.First().AccState)
        </th>
    </tr>

@foreach (var item in Model) {
    <tr id="@item.AccStateId">
        <td>
            @Html.DisplayFor(modelItem => item.AccState)
        </td>
    </tr>
}
    
</table>
    
<div class="row-fluid pagination-botton">
    
    <div class="span6">
               
        <div id="cmdEvents">
                       
            @Html.Raw(@Ajax.ActionLink("replacetxt", "CreateGeneric", "Parameters",new { page = Model.PageNumber, idParam = idP},
                             new AjaxOptions
                                 {
                                     UpdateTargetId="formParam", 
                                     InsertionMode = InsertionMode.Replace, 
                                     HttpMethod = "GET",  
                                     OnComplete = "ParamBgColorAdd()"      
                                 }, new { @class = "btn btn-success btn-xs", id="btnAddParam" }) 
		                        .ToHtmlString().Replace("replacetxt", "<i class=\"icon-plus icon-white\"></i> Adicionar"))
            
            @Html.Raw(@Ajax.ActionLink("replacetxt", "EditGeneric", "Parameters",new { page = Model.PageNumber, idParam = idP},
                             new AjaxOptions
                                 {
                                     UpdateTargetId="formParam", 
                                     InsertionMode = InsertionMode.Replace, 
                                     HttpMethod = "GET",
                                     OnComplete = "ParamBgColorEdit()" 
                                 }, new { @class = "btn btn-warning btn-xs", id="btnEditParam" }) 
		                        .ToHtmlString().Replace("replacetxt", "<i class=\"icon-pencil icon-white\"></i> Editar"))  
            
            @Html.Raw(@Ajax.ActionLink("replacetxt", "DeleteGeneric", "Parameters", new { page = Model.PageNumber, idParam = idP},
                             new AjaxOptions
                                 {
                                     UpdateTargetId="formParam", 
                                     InsertionMode = InsertionMode.Replace, 
                                     HttpMethod = "GET",
                                     OnComplete = "ParamBgColorDel()"
                                 }, new { @class = "btn btn-danger btn-xs", id="btnDelParam" }) 
		                        .ToHtmlString().Replace("replacetxt", "<i class=\"icon-remove icon-white\"></i> Eliminar"))
        </div> 
    </div> 
      
    <div class="span6" style="padding-right: 30px;">     
        <div class="pagination float-right" style="margin: 0;">
            <ul>
                @if (Model.HasPreviousPage)
                {
                    <li>
                        @Ajax.ActionLink("<<", "ListParameters", new { page = 1, idParam = idP },
                                         new AjaxOptions
                                             {
                                                 UpdateTargetId="listParam", 
                                                 InsertionMode = InsertionMode.Replace, 
                                                 HttpMethod = "GET" 
                                             }, new { @class = ""}) 
                    </li>
                
                    <li>
                        @Ajax.ActionLink("<", "ListParameters", new { page = Model.PageNumber - 1, idParam = idP},
                                         new AjaxOptions
                                             {
                                                 UpdateTargetId="listParam", 
                                                 InsertionMode = InsertionMode.Replace, 
                                                 HttpMethod = "GET" 
                                             }, new { @class = ""}) 
                    </li>
                    <li class="">
                            <a href="#" data-original-title="" title="" class="">
                                Página <b> @(Model.PageCount < Model.PageNumber ? 0 : Model.PageNumber)</b> de <b> @Model.PageCount </b>
                            </a>
                        </li>  
                }
                else
                {
                   <li class="disabled"><a href="#" data-original-title="" title="" class="">«</a></li> 
                        <li class="disabled"><a href="#" data-original-title="" title="" class=""><</a></li> 
                        <li class="">
                            <a href="#" data-original-title="" title="" class="disabled">
                                Página <b> @(Model.PageCount < Model.PageNumber ? 0 : Model.PageNumber)</b> de <b> @Model.PageCount </b>
                            </a>
                        </li> 
                }
           
                @if (Model.HasNextPage)
                {
                    <li>
                        @Ajax.ActionLink(">", "ListParameters", new { page = Model.PageNumber + 1, idParam = idP },
                                         new AjaxOptions
                                             {
                                                 UpdateTargetId="listParam", 
                                                 InsertionMode = InsertionMode.Replace, 
                                                 HttpMethod = "GET" 
                                             }, new { @class = ""}) 
                    </li>
                    <li>
                        @Ajax.ActionLink(">>", "ListParameters", new { page = Model.PageCount, idParam = idP},
                                         new AjaxOptions
                                             {
                                                 UpdateTargetId="listParam", 
                                                 InsertionMode = InsertionMode.Replace, 
                                                 HttpMethod = "GET" 
                                             }, new { @class = ""}) 
                    </li>
                }
                else
                {
                     <li class="disabled"><a href="#" data-original-title="" title="" class="disabled">></a></li> 
                     <li class="disabled"><a href="#" data-original-title="" title="" class="disabled">»</a></li>
                }
            </ul>

        </div>
    </div>
</div>


@Scripts.Render("~/bundles/culturam")

